#include <16F877.H>
#use delay(clock=4000000)
#fuses HS,NOWDT,PUT,NOPROTECT,NOBROWNOUT,NOLVP,NOCPD

#include <LCD.C>

void main (void)
{
	float value;
 	lcd_init(); //inicializa lcd
	setup_adc(ADC_CLOCK_INTERNAL);
 	setup_adc_ports( AN0_AN1_AN3);//declaracion pines analogicos
	set_adc_channel(0);
	delay_us(20);
	while(1)
	{
		if(input(pin_D0)==1)
		{	
			value = (float)read_adc()*0.019608;	
			printf(lcd_putc,"\fVOLTAJE: %f",value);
			while(input(pin_D0)==1)continue;
		}
		else
		{
			if(input(pin_D1)==1)
			{
				lcd_putc("\f presionado B");
				while(input(pin_D1)==1)continue;
			}
			else
			{
				lcd_putc("\f nada precionado");
				while(input(pin_D1)==0 && input(pin_D0)==0)continue;
			}			
		}

	}
}